home *** CD-ROM | disk | FTP | other *** search
/ The Trig Explorer / The Trig Explorer.iso / mac / Explorer / RIGHT.dxr / 00147.ls < prev    next >
Encoding:
Text File  |  1998-07-22  |  1.8 KB  |  39 lines

  1. on mouseDown me
  2.   set the cursor of sprite the spriteNum of me to [member "Closed Hand", member "Closed Hand Mask"]
  3.   repeat while the stillDown
  4.     if (the mouseH > (the left of sprite 4 + 50)) and (the mouseH < (the stageRight - 3)) then
  5.       set the locH of sprite 7 to the mouseH
  6.       set w1 to the width of sprite 3
  7.       spriteBox(3, the locH of sprite 7 - w1, the top of sprite 3, the locH of sprite 7, the bottom of sprite 3)
  8.       spriteBox(4, the left of sprite 4, the top of sprite 4, the locH of sprite 7, the bottom of sprite 4)
  9.       set theta to float(field "Ang1")
  10.       set x0 to the right of sprite 4 - the left of sprite 4
  11.       set y0 to integer(x0 * float(tan(float(theta * PI / 180.0))))
  12.       set the locH of sprite 8 to the locH of sprite 7
  13.       set the locV of sprite 8 to the locV of sprite 7 - y0
  14.       spriteBox(5, the left of sprite 5, the locV of sprite 8, the locH of sprite 8, the bottom of sprite 5)
  15.       spriteBox(6, the locH of sprite 8 - 3, the locV of sprite 8, the locH of sprite 8, the bottom of sprite 6)
  16.       set r0 to sqrt((x0 * x0) + (y0 * y0))
  17.       put r0 into field "R1"
  18.       put x0 into field "X1"
  19.       put y0 into field "Y1"
  20.       set the floatPrecision to 5
  21.       set the locH of sprite 15 to the locH of sprite 8 + 10
  22.       set the locV of sprite 15 to the locV of sprite 8 - 3
  23.       set the locH of sprite 13 to the left of sprite 4 + (x0 / 2) - 30
  24.       set the locV of sprite 13 to the top of sprite 4 - (y0 / 2) - 30
  25.       set the locH of sprite 14 to the locH of sprite 7 + 12
  26.       updateStage()
  27.     end if
  28.   end repeat
  29.   set the cursor of sprite the spriteNum of me to [member "Hand", member "Hand Mask"]
  30. end
  31.  
  32. on beginSprite me
  33.   set the cursor of sprite the spriteNum of me to [member "Hand", member "Hand Mask"]
  34. end
  35.  
  36. on endSprite me
  37.   set the cursor of sprite the spriteNum of me to 0
  38. end
  39.